{{addToMap . "ContentTitle" "报警信息列表"}}

<div class="content">
<div class="box">
  <div class="box-body">
    {{ $warningIdNums := len .WarningIds }}
    {{if ne $warningIdNums 0}}
    <table class="table table-bordered .table-hover">
        <thead>
            <tr>
                <th>ID</th>
                <th>监控点</th>
                <th>初次报警时间</th>
                <th>重复次数</th>
                <th>报警内容</th>
                <th>操作</th>
            </tr>
        </thead>
        <tbody>
            {{ range .WarningIds }}
            {{ $warning := index $.Warnings .}}
            {{ $tracing := index $.Tracings $warning.TracingId}}
                <tr warning-id="{{$warning.Id}}">
                    <td>{{$warning.Id}}</td>
                    <td><a href="/project/{{$.Project.Id}}/tracing/{{$tracing.Id}}/update">{{$tracing.Key}}</a></td>
                    <td>{{dateformat $warning.CreateTime "2006-01-02 15:04:05"}}</td>
                    <td>{{$warning.Num}}</td>
                    <td>{{substr $warning.Data 0 100}}{{$datalen := len $warning.Data}}{{if gt $datalen 100}}...{{end}}</td>
                    
                    <td>
                        <a href="#" data-toggle="modal" data-target=".warning-data-{{$warning.Id}}">查看完整内容</a>
                        <div class="modal fade warning-data-{{$warning.Id}}" tabindex="-1" role="dialog">
                            <div class="modal-dialog">
                                <div class="modal-content">
                                <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
                                    <h4 class="modal-title">报警内容</h4>
                                </div>
                                <div class="modal-body">
                                {{$warning.Data}}
                                </div>
                                </div>
                            </div>
                        </div>
                    </td>
                </tr>
            {{ end }}
        </tbody>
    </table>
    {{else}}
    <p class="text-center lead">当前没有报警信息</p>
    {{end}}
  </div>
    {{if and .paginator $warningIdNums}}
    <div class="box-footer clearfix">
    <nav class="text-center">
    <ul class="pagination pagination-sm">
        {{if .paginator.HasPrev}}
        <li>
            <a href="{{.paginator.PageLinkFirst}}">首页</a>
        </li>
        <li>
            <a href="{{.paginator.PageLinkPrev}}">上一页</a>
        </li>
        {{else}}
        <li class="disabled">
            <a>首页</a>
        </li>
        <li class="disabled">
            <a>上一页</a>
        </li>
        {{end}}

        {{range $index, $page := .paginator.Pages}}
        <li{{if $.paginator.IsActive .}} class="active"{{end}}>
            <a href="{{$.paginator.PageLink $page}}">{{$page}}</a>
        </li>
        {{end}}
        {{if .paginator.HasNext}}
        <li>
            <a href="{{.paginator.PageLinkNext}}">下一页</a>
        </li>
        <li>
            <a href="{{.paginator.PageLinkLast}}">末页</a>
        </li>
        {{else}}
        <li class="disabled">
            <a>下一页</a>
        </li>
        <li class="disabled">
            <a>末页</a>
        </li>
        {{end}}
    </ul>
    </nav>
    </div>
    {{end}}
</div>
</div>